package oj;

import java.util.Scanner;

public class Day5F {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()){
            String s1=sc.nextLine();
            String s2=sc.nextLine();
            int count=0;
            for (int i = 0; i <= s1.length(); i++) {
                StringBuilder sb=new StringBuilder(s1);
                sb.insert(i,s2);
                if(ishuiwen(sb.toString())){
                    count++;
                }
            }
            System.out.println(count);
        }
}

    private static boolean ishuiwen(String s) {
        int l=0;
        int r=s.length()-1;
        while (l<r){
            if(s.charAt(l)!=s.charAt(r)){
                return false;
            }
            l++;
            r--;
        }
        return true;
    }
    }